<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
use Hyperf\HttpServer\Router\Router;


Router::addRoute(['GET', 'POST', 'HEAD'], '/', 'App\Controller\IndexController@index');

Router::get('/favicon.ico', function () {
    return '';
});

Router::addGroup(
    '/jump', function () {

    Router::addRoute(['GET'], '/{key:\d+}', 'App\Controller\JumpController@index');//用户更新
    }
);

Router::addGroup(
    '/api', function () {
    //用户
    Router::addRoute(['POST'], '/authority/user/login', 'App\Controller\authority\UserController@login'); //用户登录
    Router::addRoute(['GET'], '/authority/user/refreshPermissions', 'App\Controller\authority\UserController@refreshPermissions'); //用户获取权限


    //公共
    Router::addRoute(['GET'], '/common/company', 'App\Controller\BaseController@company');//公司列表
    Router::addRoute(['GET'], '/common/module', 'App\Controller\BaseController@module');//模块列表
    Router::addRoute(['GET'], '/common/auth-role', 'App\Controller\BaseController@authRole');//角色列表
    Router::addRoute(['GET'], '/common/menu', 'App\Controller\BaseController@menu');//菜单列表
    Router::addRoute(['GET'], '/common/applet', 'App\Controller\BaseController@applet');//小程序列表
    Router::addRoute(['GET'], '/common/playlet', 'App\Controller\BaseController@playlet');//短剧列表
    Router::addRoute(['GET'], '/common/templete', 'App\Controller\BaseController@templete');//公共模板列表
    Router::addRoute(['GET'], '/common/platform', 'App\Controller\BaseController@platform');//投放平台
    Router::addRoute(['GET'], '/common/templeteList', 'App\Controller\BaseController@templeteList');//所有模板列表
    Router::addRoute(['GET'], '/common/backhaulSetting/{id:\d+}', 'App\Controller\BaseController@backhaulSetting');//回传监测配置列表

    //小程序配置
    Router::addRoute(['GET'], '/common/templateType', 'App\Controller\BaseController@templateType');//小程序配置模版类型
    Router::addRoute(['GET'], '/common/jumpType', 'App\Controller\BaseController@jumpType');//小程序配置公共跳转类型
    //剧集集数
    Router::addRoute(['GET'], '/delivery/playlet/episodes/{id:\d+}', 'App\Controller\delivery\PlayletController@episodes');//剧集集数
    //剧集集数
    Router::addRoute(['GET'], '/playlet/playlet/episodes/{id:\d+}', 'App\Controller\playlet\PlayletController@episodes');//剧集集数
    //这个小程序下的短剧
    Router::addRoute(['GET'], '/playlet/applet/playletList/{id:\d+}', 'App\Controller\playlet\AppletController@playletList');//这个小程序下的短剧更新
    //这个小程序下的短剧
    Router::addRoute(['GET'], '/delivery/applet/playletList/{id:\d+}', 'App\Controller\delivery\AppletController@playletList');//这个小程序下的短剧更新

    //获取公司所绑定的小程序
    Router::addRoute(['GET'], '/playlet/company/getApplet/{id:\d+}', 'App\Controller\playlet\CompanyController@getApplet');//推广链接

    //获取公司所绑定的充值模板
    Router::addRoute(['GET'], '/playlet/dataSpread/getTemplete/{company_id:\d+}/{applet_id:\d+}', 'App\Controller\playlet\DataSpreadController@getTemplete');//推广链接



    //获取公司所绑定的小程序
    Router::addRoute(['GET'], '/delivery/company/getApplet', 'App\Controller\delivery\CompanyController@getApplet');//推广链接

    //获取公司所绑定的充值模板
    Router::addRoute(['GET'], '/delivery/dataSpread/getTemplete/{applet_id:\d+}', 'App\Controller\delivery\DataSpreadController@getTemplete');//推广链接


    Router::addRoute(['GET'], '/test', 'App\Controller\playlet\PlayletEpisodesController@test');//推广链接

    //获取公司批量修改
    Router::addRoute(['GET'], '/delivery/dataSpread/deliverySettings/{applet_id:\d+}', 'App\Controller\delivery\DataSpreadController@deliverySettings');//推广链接

    //获取公司批量修改
    Router::addRoute(['GET'], '/playlet/dataSpread/deliverySettings/{company_id:\d+}/{applet_id:\d+}', 'App\Controller\playlet\DataSpreadController@deliverySettings');//推广链接

});


Router::addGroup(
    '/api', function () {
    //用户
    Router::addRoute(['GET'], '/authority/user/update/{id:\d+}', 'App\Controller\authority\UserController@update');//用户更新
    //角色
    Router::addRoute(['GET'], '/authority/autoRule/update/{id:\d+}', 'App\Controller\authority\AuthRoleController@update');//角色更新
    //菜单
    Router::addRoute(['GET'], '/authority/menu/update/{id:\d+}', 'App\Controller\authority\MenuController@update');//菜单更新
    //公司
    Router::addRoute(['GET'], '/playlet/company/update/{id:\d+}', 'App\Controller\playlet\CompanyController@update');//公司更新
    //小程序
    Router::addRoute(['GET'], '/playlet/applet/update/{id:\d+}', 'App\Controller\playlet\AppletController@update');//小程序更新
    //剧集
    Router::addRoute(['GET'], '/playlet/playlet/update/{id:\d+}', 'App\Controller\playlet\PlayletController@update');//剧集更新
    //菜单角色列表
    Router::addRoute(['GET'], '/authority/autoRule/menuList/{id:\d+}', 'App\Controller\authority\AuthRoleController@menuList');//菜单角色列表
    //剧集集数更新
    Router::addRoute(['GET'], '/playlet/episodes/update/{id:\d+}', 'App\Controller\playlet\PlayletEpisodesController@update');//剧集集数更新
    //充值模板
    Router::addRoute(['GET'], '/playlet/rechargeTemplate/update/{id:\d+}', 'App\Controller\playlet\RechargeTemplateController@update');//充值模板
    //小程序与短剧绑定
    Router::addRoute(['GET'], '/playlet/applet/bindPlaylet/{id:\d+}', 'App\Controller\playlet\AppletController@bindPlaylet');//小程序绑定短剧
    //推广链接更新
    Router::addRoute(['GET'], '/playlet/dataSpread/update/{id:\d+}', 'App\Controller\playlet\DataSpreadController@update');//推广链接更新
    //回传监测配置
    Router::addRoute(['GET'], '/playlet/dataBackhaulSetting/update/{id:\d+}', 'App\Controller\playlet\DataBackhaulSettingController@update');//推广链接更新
    //推广连接-监测链接
    Router::addRoute(['GET'], '/playlet/dataSpread/monitoringLink/{id:\d+}', 'App\Controller\playlet\DataSpreadController@monitoringLink');//监测链接更新
    //推广连接-推广链接
    Router::addRoute(['GET'], '/playlet/dataSpread/promotionLink/{id:\d+}', 'App\Controller\playlet\DataSpreadController@promotionLink');//推广链接
    //小程序导航配置详情
    Router::addRoute(['GET'], '/playlet/playletBlocks/update/{id:\d+}', 'App\Controller\playlet\PlayletBlocksController@update');//小程序导航配置详情
    //banner详情
    Router::addRoute(['GET'], '/playlet/baseBanner/update/{id:\d+}', 'App\Controller\playlet\BaseBannerController@update');//banner详情


    //推广连接-监测链接
    Router::addRoute(['GET'], '/delivery/dataSpread/monitoringLink/{id:\d+}', 'App\Controller\delivery\DataSpreadController@monitoringLink');//监测链接更新
    //推广连接-推广链接
    Router::addRoute(['GET'], '/delivery/dataSpread/promotionLink/{id:\d+}', 'App\Controller\delivery\DataSpreadController@promotionLink');//推广链接


    //回传监测配置
    Router::addRoute(['GET'], '/delivery/dataBackhaulSetting/update/{id:\d+}', 'App\Controller\delivery\DataBackhaulSettingController@update');//推广链接更新

    //充值模板
    Router::addRoute(['GET'], '/delivery/rechargeTemplate/update/{id:\d+}', 'App\Controller\delivery\RechargeTemplateController@update');//充值模板

    //推广链接更新
    Router::addRoute(['GET'], '/delivery/dataSpread/update/{id:\d+}', 'App\Controller\delivery\DataSpreadController@update');//推广链接更新


}, ['middleware' => [\App\Middleware\AuthMiddleware::class]]);


//ad
Router::addGroup(
    '/api', function () {

     //修改密码
    Router::addRoute(['POST'], '/authority/user/changePwd', 'App\Controller\authority\UserController@changePwd'); //用户修改密码
    Router::addRoute(['POST'], '/authority/user/changeRealName', 'App\Controller\authority\UserController@changeRealName'); //用户修改昵称
    //用户管理
    Router::addRoute(['GET'], '/authority/user', 'App\Controller\authority\UserController@index'); //用户列表
    Router::addRoute(['POST'], '/authority/user/create', 'App\Controller\authority\UserController@create');//用户创建
    Router::addRoute(['POST'], '/authority/user/update/{id:\d+}', 'App\Controller\authority\UserController@update');//用户更新
//    Router::addRoute(['GET'], '/authority/user/{id:\d+}', 'App\Controller\authority\UserController@view');//用户详情
    Router::addRoute(['DELETE'], '/authority/user/delete/{id:\d+}', 'App\Controller\authority\UserController@delete');//角色删除
    //角色列表
    Router::addRoute(['GET'], '/authority/autoRule', 'App\Controller\authority\AuthRoleController@index'); //角色列表
    Router::addRoute(['POST'], '/authority/autoRule/create', 'App\Controller\authority\AuthRoleController@create');//角色创建
    Router::addRoute(['POST'], '/authority/autoRule/update/{id:\d+}', 'App\Controller\authority\AuthRoleController@update');//角色更新
//    Router::addRoute(['GET'], '/authority/autoRule/{id:\d+}', 'App\Controller\authority\AuthRoleController@view');//角色详情
    Router::addRoute(['DELETE'], '/authority/autoRule/delete/{id:\d+}', 'App\Controller\authority\AuthRoleController@delete');//角色删除
    Router::addRoute(['POST'], '/authority/autoRule/authorizeSave', 'App\Controller\authority\AuthRoleController@AuthorizeSave');//菜单权限修改

    //菜单列表
    Router::addRoute(['GET'], '/authority/menu', 'App\Controller\authority\MenuController@index'); //菜单列表
    Router::addRoute(['POST'], '/authority/menu/create', 'App\Controller\authority\MenuController@create');//菜单创建
    Router::addRoute(['POST'], '/authority/menu/update/{id:\d+}', 'App\Controller\authority\MenuController@update');//菜单更新
//    Router::addRoute(['GET'], '/authority/menu/{id:\d+}', 'App\Controller\authority\MenuController@view');//菜单详情
    Router::addRoute(['DELETE'], '/authority/menu/delete/{id:\d+}', 'App\Controller\authority\MenuController@delete');//菜单删除



    //公司列表
    Router::addRoute(['GET'], '/playlet/company', 'App\Controller\playlet\CompanyController@index'); //公司列表
    Router::addRoute(['POST'], '/playlet/company/create', 'App\Controller\playlet\CompanyController@create');//公司创建
    Router::addRoute(['POST'], '/playlet/company/update/{id:\d+}', 'App\Controller\playlet\CompanyController@update');//公司更新
//    Router::addRoute(['GET'], '/playlet/company/{id:\d+}', 'App\Controller\playlet\CompanyController@view');//公司详情
    Router::addRoute(['DELETE'], '/playlet/company/delete/{id:\d+}', 'App\Controller\playlet\CompanyController@delete');//公司删除

    //小程序列表
    Router::addRoute(['GET'], '/playlet/applet', 'App\Controller\playlet\AppletController@index'); //小程序列表
    Router::addRoute(['POST'], '/playlet/applet/create', 'App\Controller\playlet\AppletController@create');//小程序创建
    Router::addRoute(['POST'], '/playlet/applet/update/{id:\d+}', 'App\Controller\playlet\AppletController@update');//小程序更新
//    Router::addRoute(['GET'], '/playlet/applet/{id:\d+}', 'App\Controller\playlet\AppletController@view');//小程序详情
    Router::addRoute(['DELETE'], '/playlet/applet/delete/{id:\d+}', 'App\Controller\playlet\AppletController@delete');//小程序删除

    //小程序与短剧绑定
    Router::addRoute(['POST'], '/playlet/applet/bindPlaylet/{id:\d+}', 'App\Controller\playlet\AppletController@bindPlaylet');//小程序绑定短剧

    //短剧列表
    Router::addRoute(['GET'], '/playlet/playlet', 'App\Controller\playlet\PlayletController@index'); //短剧列表
    Router::addRoute(['POST'], '/playlet/playlet/create', 'App\Controller\playlet\PlayletController@create');//短剧创建
    Router::addRoute(['POST'], '/playlet/playlet/update/{id:\d+}', 'App\Controller\playlet\PlayletController@update');//短剧更新
//    Router::addRoute(['GET'], '/playlet/playlet/{id:\d+}', 'App\Controller\playlet\PlayletController@view');//短剧详情
    Router::addRoute(['DELETE'], '/playlet/playlet/delete/{id:\d+}', 'App\Controller\playlet\PlayletController@delete');//短剧删除

    Router::addRoute(['GET'], '/playlet/playlet/episodesList/{id:\d+}', 'App\Controller\playlet\PlayletController@episodesList');//短剧查看剧集
    //短剧提审
    Router::addRoute(['GET'], '/playlet/playlet/auditDrama/{id:\d+}/{type:\d+}', 'App\Controller\playlet\PlayletController@auditDrama'); //短剧提审

    //短剧批量上传集数
    Router::addRoute(['POST'], '/playlet/playlet/batchUpload/{id:\d+}', 'App\Controller\playlet\PlayletController@batchUpload'); //短剧批量上传集数


    //剧集集数列表
    Router::addRoute(['GET'], '/playlet/episodes', 'App\Controller\playlet\PlayletEpisodesController@index'); //集数列表
    Router::addRoute(['POST'], '/playlet/episodes/create', 'App\Controller\playlet\PlayletEpisodesController@create');//集数创建
    Router::addRoute(['POST'], '/playlet/episodes/update/{id:\d+}', 'App\Controller\playlet\PlayletEpisodesController@update');//剧集更新
//    Router::addRoute(['GET'], '/playlet/episodes/{id:\d+}', 'App\Controller\playlet\PlayletEpisodesController@view');//集数详情
    Router::addRoute(['DELETE'], '/playlet/episodes/delete/{id:\d+}', 'App\Controller\playlet\PlayletEpisodesController@delete');//集数删除
    Router::addRoute(['POST'], '/playlet/episodes/examine', 'App\Controller\playlet\PlayletEpisodesController@examine');//集数审核




    //充值模板列表
    Router::addRoute(['GET'], '/playlet/rechargeTemplate', 'App\Controller\playlet\RechargeTemplateController@index'); //充值模板列表
    Router::addRoute(['POST'], '/playlet/rechargeTemplate/create', 'App\Controller\playlet\RechargeTemplateController@create');//充值模板创建
    Router::addRoute(['POST'], '/playlet/rechargeTemplate/update/{id:\d+}', 'App\Controller\playlet\RechargeTemplateController@update');//充值模板更新
//    Router::addRoute(['GET'], '/playlet/rechargeTemplate/{id:\d+}', 'App\Controller\playlet\RechargeTemplateController@view');//充值模板详情
    Router::addRoute(['DELETE'], '/playlet/rechargeTemplate/delete/{id:\d+}', 'App\Controller\playlet\RechargeTemplateController@delete');//充值模板删除



    //推广连接-批量修改
    Router::addRoute(['POST'], '/playlet/dataSpread/batchSettings', 'App\Controller\playlet\DataSpreadController@batchSettings');//推广链接批量修改


    //推广链接列表
    Router::addRoute(['GET'], '/playlet/dataSpread', 'App\Controller\playlet\DataSpreadController@index'); //推广链接列表
    Router::addRoute(['POST'], '/playlet/dataSpread/create', 'App\Controller\playlet\DataSpreadController@create');//推广链接创建
    Router::addRoute(['POST'], '/playlet/dataSpread/update/{id:\d+}', 'App\Controller\playlet\DataSpreadController@update');//推广链接更新
    Router::addRoute(['DELETE'], '/playlet/dataSpread/delete/{id:\d+}', 'App\Controller\playlet\DataSpreadController@delete');//推广链接删除
    //推广连接-监测链接
    Router::addRoute(['POST'], '/playlet/dataSpread/monitoringLink/{id:\d+}', 'App\Controller\playlet\DataSpreadController@monitoringLink');//监测链接更新

    //回传监测配置列表
    Router::addRoute(['GET'], '/playlet/dataBackhaulSetting', 'App\Controller\playlet\DataBackhaulSettingController@index'); //回传监测配置列表
    Router::addRoute(['POST'], '/playlet/dataBackhaulSetting/create', 'App\Controller\playlet\DataBackhaulSettingController@create');//回传监测配置创建
    Router::addRoute(['POST'], '/playlet/dataBackhaulSetting/update/{id:\d+}', 'App\Controller\playlet\DataBackhaulSettingController@update');//回传监测配置更新
    Router::addRoute(['DELETE'], '/playlet/dataBackhaulSetting/delete/{id:\d+}', 'App\Controller\playlet\DataBackhaulSettingController@delete');//回传监测配置删除



    //小程序导航配置
    Router::addRoute(['GET'], '/playlet/playletBlocks', 'App\Controller\playlet\PlayletBlocksController@index'); //小程序导航配置列表
    Router::addRoute(['POST'], '/playlet/playletBlocks/create', 'App\Controller\playlet\PlayletBlocksController@create');//小程序导航配置创建
    Router::addRoute(['POST'], '/playlet/playletBlocks/update/{id:\d+}', 'App\Controller\playlet\PlayletBlocksController@update');//小程序导航配置更新
    Router::addRoute(['DELETE'], '/playlet/playletBlocks/delete/{id:\d+}', 'App\Controller\playlet\PlayletBlocksController@delete');//小程序导航配置删除


    //小程序导航配置
    Router::addRoute(['GET'], '/playlet/playletBlocksRanking', 'App\Controller\playlet\PlayletBlocksRankingController@index'); //小程序导航配置列表
    Router::addRoute(['POST'], '/playlet/playletBlocksRanking/create', 'App\Controller\playlet\PlayletBlocksRankingController@create');//小程序导航配置创建
    Router::addRoute(['POST'], '/playlet/playletBlocksRanking/update/{id:\d+}', 'App\Controller\playlet\PlayletBlocksRankingController@update');//小程序导航配置更新
    Router::addRoute(['DELETE'], '/playlet/playletBlocksRanking/delete/{id:\d+}', 'App\Controller\playlet\PlayletBlocksRankingController@delete');//小程序导航配置删除


    //上传图片
    Router::addRoute(['POST'], '/playlet/sts/uploadPath', 'App\Controller\playlet\StsController@uploadPath'); //上传图片

    //banner
    Router::addRoute(['GET'], '/playlet/baseBanner', 'App\Controller\playlet\BaseBannerController@index'); //banner列表
    Router::addRoute(['POST'], '/playlet/baseBanner/create', 'App\Controller\playlet\BaseBannerController@create');//banner创建
    Router::addRoute(['POST'], '/playlet/baseBanner/update/{id:\d+}', 'App\Controller\playlet\BaseBannerController@update');//banner更新
    Router::addRoute(['DELETE'], '/playlet/baseBanner/delete/{id:\d+}', 'App\Controller\playlet\BaseBannerController@delete');//banner删除



    //投放短剧列表
    Router::addRoute(['GET'], '/delivery/playlet', 'App\Controller\delivery\PlayletController@index'); //投放短剧列表
    Router::addRoute(['GET'], '/delivery/playlet/episodesList/{id:\d+}', 'App\Controller\delivery\PlayletController@episodesList');//短剧查看剧集


    //充值模板列表
    Router::addRoute(['GET'], '/delivery/rechargeTemplate', 'App\Controller\delivery\RechargeTemplateController@index'); //充值模板列表
    Router::addRoute(['POST'], '/delivery/rechargeTemplate/create', 'App\Controller\delivery\RechargeTemplateController@create');//充值模板创建
    Router::addRoute(['POST'], '/delivery/rechargeTemplate/update/{id:\d+}', 'App\Controller\delivery\RechargeTemplateController@update');//充值模板更新
//    Router::addRoute(['GET'], '/delivery/rechargeTemplate/{id:\d+}', 'App\Controller\delivery\RechargeTemplateController@view');//充值模板详情
    Router::addRoute(['DELETE'], '/delivery/rechargeTemplate/delete/{id:\d+}', 'App\Controller\delivery\RechargeTemplateController@delete');//充值模板删除

    //推广连接-批量修改
    Router::addRoute(['POST'], '/delivery/dataSpread/batchSettings', 'App\Controller\delivery\DataSpreadController@batchSettings');//推广链接批量修改


    //推广链接列表
    Router::addRoute(['GET'], '/delivery/dataSpread', 'App\Controller\delivery\DataSpreadController@index'); //推广链接列表
    Router::addRoute(['POST'], '/delivery/dataSpread/create', 'App\Controller\delivery\DataSpreadController@create');//推广链接创建
    Router::addRoute(['POST'], '/delivery/dataSpread/update/{id:\d+}', 'App\Controller\delivery\DataSpreadController@update');//推广链接更新
    Router::addRoute(['DELETE'], '/delivery/dataSpread/delete/{id:\d+}', 'App\Controller\delivery\DataSpreadController@delete');//推广链接删除
    //推广连接-监测链接
    Router::addRoute(['POST'], '/delivery/dataSpread/monitoringLink/{id:\d+}', 'App\Controller\delivery\DataSpreadController@monitoringLink');//监测链接更新

    //回传监测配置列表
    Router::addRoute(['GET'], '/delivery/dataBackhaulSetting', 'App\Controller\delivery\DataBackhaulSettingController@index'); //回传监测配置列表
    Router::addRoute(['POST'], '/delivery/dataBackhaulSetting/create', 'App\Controller\delivery\DataBackhaulSettingController@create');//回传监测配置创建
    Router::addRoute(['POST'], '/delivery/dataBackhaulSetting/update/{id:\d+}', 'App\Controller\delivery\DataBackhaulSettingController@update');//回传监测配置更新
    Router::addRoute(['DELETE'], '/delivery/dataBackhaulSetting/delete/{id:\d+}', 'App\Controller\delivery\DataBackhaulSettingController@delete');//回传监测配置删除

    //订单列表
    Router::addRoute(['GET'], '/delivery/payment', 'App\Controller\delivery\PaymentController@index'); //订单列表
    //订单统计
    Router::addRoute(['GET'], '/delivery/OrderStatistics', 'App\Controller\delivery\OrderStatisticsController@index'); //订单统计
    //推广链接统计
    Router::addRoute(['GET'], '/delivery/SpreadStatistics', 'App\Controller\delivery\SpreadStatisticsController@index'); //推广链接


},
    ['middleware' => [\App\Middleware\AuthMiddleware::class,App\Middleware\ValidateMiddleware::class]]
);
